From: kfraser@dhcp93.uk.xensource.com Date: Tue, 27 Jun 2006 09:36:51 +0000 (+0100) Subject: [XEN][EMUL] x86 emulator should support 32-bit offsets in real mode. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15913^2~30 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=4b56090e1d66acc0e3895827a7fa17a86f3a78cd;p=xen.git [XEN][EMUL] x86 emulator should support 32-bit offsets in real mode. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c index 99e707d4f0..f8192a2819 100644 --- a/xen/arch/x86/x86_emulate.c +++ b/xen/arch/x86/x86_emulate.c @@ -374,9 +374,8 @@ do{ __asm__ __volatile__ ( \ /* Access/update address held in a register, based on addressing mode. */ #define register_address(sel, reg) \ - ((ad_bytes == sizeof(unsigned long)) ? (reg) : \ - ((mode == X86EMUL_MODE_REAL) ? /* implies ad_bytes == 2 */ \ - (((unsigned long)(sel) << 4) + ((reg) & 0xffff)) : \ + (((mode == X86EMUL_MODE_REAL) ? ((unsigned long)(sel) << 4) : 0) + \ + ((ad_bytes == sizeof(unsigned long)) ? (reg) : \ ((reg) & ((1UL << (ad_bytes << 3)) - 1)))) #define register_address_increment(reg, inc) \ do { \ @@ -510,10 +509,6 @@ x86_emulate_memop( } done_prefixes: - /* Note quite the same as 80386 real mode, but hopefully good enough. */ - if ( (mode == X86EMUL_MODE_REAL) && (ad_bytes != 2) ) - goto cannot_emulate; - /* REX prefix. */ if ( (mode == X86EMUL_MODE_PROT64) && ((b & 0xf0) == 0x40) ) {